-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: base implementation of default value #246
Conversation
7c83528
to
38935ff
Compare
@waynexia @ShiKaiWi @jiacai2050 PTAL, it is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! The implementation is very clean 👍 I left some tiny comments
Co-authored-by: Ruihang Xia <waynestxia@gmail.com>
Co-authored-by: Ruihang Xia <waynestxia@gmail.com>
Co-authored-by: Ruihang Xia <waynestxia@gmail.com>
@ygf11 I have left another few comments, PLAT. The general implementation is concise, good job! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* feat: base implemment of default value * Add some unit tests * Make lint happy * replace CastExpr with TryCastExpr when filling default value * Update df_operator/src/visitor.rs Co-authored-by: Ruihang Xia <waynestxia@gmail.com> * Update interpreters/src/insert.rs Co-authored-by: Ruihang Xia <waynestxia@gmail.com> * Update sql/src/plan.rs Co-authored-by: Ruihang Xia <waynestxia@gmail.com> * Add integration tests * Fix minor comments * Fix integration test * Merge remote-tracking branch 'upstream/main' into simple-default-value * Fix minor comments * Improve conversion from Output to inner records Co-authored-by: Ruihang Xia <waynestxia@gmail.com>
Which issue does this PR close?
Closes #249
Part of #252
Rationale for this change
Default value
is a very useful feature.What changes are included in this PR?
expr
incolumn default value option
when create table, and only support exprs which does not reference other columns, like 10, 1+1, now()..default-value
infos forshow create xxx
.default value option
was defined when insert.Are there any user-facing changes?
Create Table
can definedefault value option
for columns.Show create Table xxx
will also returndefault value
infos.Insert
can auto fill withdefault value
option.How does this change test
Unit tests.